function judgeNetworkStatus(callback) {
  wx.getNetworkType({
    success(res) {
      const networkType = res.networkType
      // console.log("u",res);
      if ("none" == networkType) {
        // wx.hideLoading()
        wx.showLoading({
          title: '网络连接失败',
          mask: true
        })
        callback(networkType)
        judgeNetworkStatus(callback);
      } else {
        //wx.hideLoading()
        // console.log("u", res.errMsg);
        if ("getNetworkType:ok" === res.errMsg){ 
           callback(networkType)
        }
        else
        {
          callback("none")
          console.log("u", "xxx none");
        }
       
      }
    },
    fail(err) {
      console.log("err:",err)
    }
    ,
    complete(cpe) {
      // console.log("1",cpe)
    }
  })
}

module.exports = {
  judgeNetworkStatus: judgeNetworkStatus
};